home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-03-31 | 2.1 KB | 46 lines | [TEXT/R*ch] |
- "Jamie's Partial Resources." Implements the partial resource
- calls, which are built into system 7, in system 6 as well.
- Just call jReadPartialResource and jWritePartialResource
- instead of ReadPartialResource and WritePartialResource.
-
- Note that you can read or write any section of a resource
- without loading the resource itself into memory; the code
- finds the location of the resource on disk, and reads directly
- from the resource fork. So you can, for example, access the
- middle ten bytes of a 10-meg resource in a 10K heap.
-
- Changing the size of a resource is not supported; attemping
- to do so will drop you into the debugger (under system 6).
- It's another case of "I don't need it, so I didn't bother
- writing it." Implementing this is another order of magnitude
- harder than reading or writing, and implementing it efficiently
- is another order of magnitude harder than that. Don't count
- on it any time soon, sorry.
-
- (c) Copyright 1992 by Jamie R. McCarthy. All rights reserved.
- This code can be both distributed and used freely.
- Internet: k044477@kzoo.edu AppleLink: j.mccarthy
-
- [new info for version 1.0.1]
-
- This archive contains the .c and .h files for JPartialResources 1.0.1.
- The code extends the partial-resource calls into system 6--and yes it
- does read in only the section requested, not the whole resource.
- CFlexiDataFile uses JPartialResources; if you're using that class,
- this new version just drops right in.
-
- 1.0.1 is a little better about error-handling--it sets ResErr instead of
- dropping into the debugger--and it is a little more fastidious about
- using Gestalt, though it probably won't ever make any difference.
-
- But the main new feature is that it doesn't go to disk twice when once
- is enough. Marco Piovanelli was kind enough to point out that some of
- the information I needed is resident in RAM. So this version should be
- quite a bit faster than 1.0, especially if you're making many accesses
- to small amounts of data.
-
- This code shipped in our latest game, which depends on it quite
- heavily. So I'd give it very high reliability marks.
-
- It's freeware--if you like it, drop me a line.
-